home *** CD-ROM | disk | FTP | other *** search
-
- program dots3; { DOTS3.PAS }
- { Parallax screensaver, run a few times to see all. By Bas van Gaalen }
- uses u_vga,u_kb;
- const
- xspd=1; yspd=1;
- noftab=6; txtcol=31; collen=17;
- coltab:array[0..noftab,0..collen] of byte=(
- (3,3,11,3,11,11,15,11,15,15,7,15,7,7,8,7,8,8),
- (8,8,7,8,7,7,15,7,15,15,7,15,7,7,8,7,8,8),
- (1,1,9,1,9,9,11,9,11,11,9,11,9,9,1,9,1,1),
- (4,4,12,4,12,12,15,12,15,15,12,15,12,12,4,12,4,4),
- (3,3,11,3,11,11,15,11,15,15,11,15,11,11,3,11,3,3),
- (3,3,11,3,11,11,15,11,15,15,10,15,10,10,2,10,2,2),
- (4,4,12,4,12,12,15,12,15,15,11,15,11,11,3,11,3,3));
- sintab:array[0..1000] of byte=(
- 100,100,100,100,100,100, 99, 99, 99, 99, 98, 98, 98, 97, 97,
- 96, 96, 95, 95, 94, 94, 93, 92, 92, 91, 90, 89, 88, 88, 87,
- 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72,
- 71, 69, 68, 67, 66, 65, 64, 63, 61, 60, 59, 58, 57, 55, 54,
- 53, 52, 51, 50, 48, 47, 46, 45, 44, 43, 42, 41, 39, 38, 37,
- 36, 35, 34, 33, 32, 32, 31, 30, 29, 28, 27, 26, 26, 25, 24,
- 23, 23, 22, 22, 21, 20, 20, 19, 19, 19, 18, 18, 17, 17, 17,
- 17, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17,
- 17, 17, 18, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 24,
- 24, 25, 26, 27, 27, 28, 29, 30, 31, 32, 33, 33, 34, 35, 36,
- 37, 38, 39, 40, 41, 42, 43, 45, 46, 47, 48, 49, 50, 51, 52,
- 53, 54, 55, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
- 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 81, 82,
- 83, 84, 85, 85, 86, 87, 88, 88, 89, 90, 90, 91, 91, 92, 92,
- 93, 93, 94, 94, 95, 95, 95, 96, 96, 97, 97, 97, 97, 98, 98,
- 98, 98, 99, 99, 99, 99, 99, 99, 99,100,100,100,100,100,100,
- 100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,
- 100,100,100,100,100,100,100,100,100,100,100,100,101,101,101,
- 101,101,101,101,102,102,102,102,103,103,103,103,104,104,105,
- 105,105,106,106,107,107,108,108,109,109,110,110,111,112,112,
- 113,114,115,115,116,117,118,119,119,120,121,122,123,124,125,
- 126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,
- 141,142,143,145,146,147,148,149,150,151,152,153,154,155,157,
- 158,159,160,161,162,163,164,165,166,167,167,168,169,170,171,
- 172,173,173,174,175,176,176,177,178,178,179,179,180,180,181,
- 181,182,182,182,183,183,183,183,184,184,184,184,184,184,184,
- 184,184,184,184,184,183,183,183,183,182,182,181,181,181,180,
- 180,179,178,178,177,177,176,175,174,174,173,172,171,170,169,
- 168,168,167,166,165,164,163,162,161,159,158,157,156,155,154,
- 153,152,150,149,148,147,146,145,143,142,141,140,139,137,136,
- 135,134,133,132,131,129,128,127,126,125,124,123,122,121,120,
- 119,118,117,116,115,114,113,112,112,111,110,109,108,108,107,
- 106,106,105,105,104,104,103,103,102,102,102,101,101,101,101,
- 100,100,100,100,100,100,100,100,100,100,100,101,101,101,101,
- 102,102,102,103,103,104,104,105,105,106,106,107,108,108,109,
- 110,111,112,112,113,114,115,116,117,118,119,120,121,122,123,
- 124,125,126,127,128,129,131,132,133,134,135,136,137,139,140,
- 141,142,143,145,146,147,148,149,150,152,153,154,155,156,157,
- 158,159,161,162,163,164,165,166,167,168,168,169,170,171,172,
- 173,174,174,175,176,177,177,178,178,179,180,180,181,181,181,
- 182,182,183,183,183,183,184,184,184,184,184,184,184,184,184,
- 184,184,184,183,183,183,183,182,182,182,181,181,180,180,179,
- 179,178,178,177,176,176,175,174,173,173,172,171,170,169,168,
- 167,167,166,165,164,163,162,161,160,159,158,157,155,154,153,
- 152,151,150,149,148,147,146,145,143,142,141,140,139,138,137,
- 136,135,134,133,132,131,130,129,128,127,126,125,124,123,122,
- 121,120,119,119,118,117,116,115,115,114,113,112,112,111,110,
- 110,109,109,108,108,107,107,106,106,105,105,105,104,104,103,
- 103,103,103,102,102,102,102,101,101,101,101,101,101,101,100,
- 100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,
- 100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,
- 100,100, 99, 99, 99, 99, 99, 99, 99, 98, 98, 98, 98, 97, 97,
- 97, 97, 96, 96, 95, 95, 95, 94, 94, 93, 93, 92, 92, 91, 91,
- 90, 90, 89, 88, 88, 87, 86, 85, 85, 84, 83, 82, 81, 81, 80,
- 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 65,
- 64, 63, 62, 61, 60, 59, 58, 57, 55, 54, 53, 52, 51, 50, 49,
- 48, 47, 46, 45, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33,
- 33, 32, 31, 30, 29, 28, 27, 27, 26, 25, 24, 24, 23, 22, 22,
- 21, 21, 20, 20, 19, 19, 18, 18, 18, 17, 17, 17, 17, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18,
- 18, 19, 19, 19, 20, 20, 21, 22, 22, 23, 23, 24, 25, 26, 26,
- 27, 28, 29, 30, 31, 32, 32, 33, 34, 35, 36, 37, 38, 39, 41,
- 42, 43, 44, 45, 46, 47, 48, 50, 51, 52, 53, 54, 55, 57, 58,
- 59, 60, 61, 63, 64, 65, 66, 67, 68, 69, 71, 72, 73, 74, 75,
- 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 88, 89,
- 90, 91, 92, 92, 93, 94, 94, 95, 95, 96, 96, 97, 97, 98, 98,
- 98, 99, 99, 99, 99,100,100,100,100,100,100);
-
- procedure plotter;
- const startcount=150;
- var xst,yst,i,dots,countdown,on,off,txtx,txty:word; colstart,xstep,ystep:byte;
- begin
- randomize;
- dots:=(20+random(20))*succ(collen);
- colstart:=random(succ(noftab));
- xstep:=succ(random(8));
- ystep:=succ(random(8)); if ystep=xstep then inc(ystep);
- xst:=0; yst:=0; countdown:=1; txtx:=0; txty:=0;
- repeat
- vretrace;
- for i:=0 to dots do begin
- off:=(sintab[(xst+i*xstep) mod 1000])+50+sintab[(yst+i*ystep) mod 1000]*320;
- on:=(sintab[(xst+xspd+i*xstep) mod 1000])+50+sintab[(yst+yspd+i*ystep) mod 1000]*320;
- if mem[u_vidseg:off]<>txtcol then mem[u_vidseg:off]:=0;
- if mem[u_vidseg:on]<>txtcol then mem[u_vidseg:on]:=coltab[colstart,i mod succ(collen)];
- end;
- xst:=(xst+xspd) mod 1000; yst:=(yst+yspd) mod 1000;
- dec(countdown);
- if countdown=0 then begin
- writetxt(' press a key ',txtx,txty,0);
- txtx:=50+random(132); txty:=50+random(100);
- writetxt(' press a key ',txtx,txty,txtcol);
- countdown:=startcount;
- end;
- until keypressed;
- end;
-
- begin
- usefont:=font8x8;
- setvideo($13);
- plotter;
- setvideo(u_lm);
- end.
-